home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <html><head><title>WeekDay Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03030105"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
-
- p.P1{
- }
- p.P2{
- }
- span.T1{
- font-weight:bold;}
- </style></head><body>
-
-
- <help:to-be-embedded Eid="weekday" xmlns:help="http://openoffice.org/2000/help">
- <p class="Head1"><help:link Id="66586">WeekDay Function [Runtime]</help:link></p>
- <p class="Paragraph">Returns the number corresponding to the weekday from a serial date number generated with DateSerial or DateValue.</p>
- </help:to-be-embedded>
- <p class="Paragraph"><span class="T1">Syntax</span>:</p>
- <p class="Paragraph">WeekDay (Number) <help:key-word value="WeekDay" tag="kw66586_1" xmlns:help="http://openoffice.org/2000/help"/></p>
- <p class="Paragraph"><span class="T1">Return value</span>:</p>
- <p class="Paragraph">Integer</p>
- <p class="Paragraph"><span class="T1">Parameter</span>:</p>
- <p class="Paragraph">Number: Integer expression that contains the serial date number from which to calculate the weekday (1-7).</p>
- <p class="Paragraph">The following example enables you to enter a date, and it calculates the weekday via the WeekDay function.</p>
- <p class="P2">Example:</p>
- <p class="PropText">Sub ExampleWeekDay</p>
- <p class="PropText">Dim sDay As String</p>
- <p class="PropText">REM Return and display the day of the week</p>
- <p class="PropText">Select Case WeekDay( Now )</p>
- <p class="PropText">case 1</p>
- <p class="PropText">sDay="Sunday"</p>
- <p class="PropText">case 2</p>
- <p class="PropText">sDay="Monday"</p>
- <p class="PropText">case 3</p>
- <p class="PropText">sDay="Tuesday"</p>
- <p class="PropText">case 4</p>
- <p class="PropText">sDay="Wednesday"</p>
- <p class="PropText">case 5</p>
- <p class="PropText">sDay="Thursday"</p>
- <p class="PropText">case 6</p>
- <p class="PropText">sDay="Friday"</p>
- <p class="PropText">case 7</p>
- <p class="PropText">sDay="Saturday"</p>
- <p class="PropText">End Select</p>
- <p class="PropText">msgbox "" + sDay,64,"Today is"</p>
- <p class="PropText">End Sub</p>
- </body></html>